﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Default.Master" AutoEventWireup="true" CodeBehind="Festivals.aspx.cs" Inherits="Project_mfa.WebForm3" %>

<asp:Content ID="headFestivals" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="mainFestivals" ContentPlaceHolderID="cphContent" runat="server">
        <div class="row">
            <div class="col col_16">
                <asp:GridView
                    ID="festGrid"
                    runat="server"
                    DataSourceID="EntityDataSourceFestGrid"
                    AutoGenerateSelectButton="True"
                    DataKeyNames="fest_id"
                    SelectedRowStyle-BackColor="#6755ab"
                    BackColor="#9b9ce1"
                    ForeColor="Snow"
                    BorderColor="LightPink"
                    HeaderStyle-BackColor="#d49c5f" AutoGenerateColumns="False" AllowPaging="True" AllowSorting="True">
                    <Columns>
                        <%-- <asp:BoundField DataField="fest_id" HeaderText="fest_id" ReadOnly="True" SortExpression="fest_id" />--%>
                        <asp:BoundField DataField="fest_naam" HeaderText="Festival" SortExpression="fest_naam" />
                        <asp:BoundField DataField="fest_locatie" HeaderText="location" SortExpression="fest_locatie" />
                        <asp:BoundField DataField="fest_datum" HeaderText="date" SortExpression="fest_datum" />
                        <asp:BoundField DataField="fest_duur" HeaderText="duration" SortExpression="fest_duur" />
                    </Columns>
                    <HeaderStyle BackColor="#d49c5f"></HeaderStyle>
                </asp:GridView>
                <asp:EntityDataSource ID="EntityDataSourceFestGrid" runat="server" ConnectionString="name=groep1_festivalsEntities" DefaultContainerName="groep1_festivalsEntities" EnableFlattening="False" EntitySetName="festivals">
                </asp:EntityDataSource>

                <br />

                <asp:GridView
                    ID="bandGrid"
                    runat="server"
                    DataSourceID="EntityDataSourceBands"
                    AllowPaging="True"
                    PageSize="5"
                    BackColor="#9fbf74"
                    ForeColor="WhiteSmoke" AutoGenerateColumns="False" DataKeyNames="fest_id,band_id,datum,uur"
                    HeaderStyle-BackColor="#d49c5f"
                    AllowSorting="True">
                    <Columns>
                        <%--<asp:BoundField DataField="fest_id" HeaderText="fest_id" ReadOnly="True" SortExpression="fest_id" />--%>
                        <asp:BoundField DataField="band_naam" HeaderText="Name" SortExpression="band_naam" ReadOnly="True" />
                        <asp:BoundField DataField="pod_omschrijving" HeaderText="Stage" SortExpression="pod_omschrijving" />
                        <asp:BoundField DataField="datum" DataFormatString="{0:d}" HeaderText="Date" SortExpression="datum" ReadOnly="True" />
                        <asp:BoundField DataField="uur" HeaderText="Hour" ReadOnly="True" SortExpression="uur" />
                    </Columns>
                </asp:GridView>
                <asp:EntityDataSource AutoGenerateOrderByClause="true" CommandText="Select bandsperfestival.band_id, bandsperfestival.fest_id, bands.band_naam, podia.pod_omschrijving, bandsperfestival.datum,bandsperfestival.uur from bandsperfestival, bands, podia where bands.band_id = bandsperfestival.band_id and podia.pod_id = bandsperfestival.pod_id" AutoGenerateWhereClause="true" Where="" ID="EntityDataSourceBands" runat="server" ConnectionString="name=groep1_festivalsEntities" DefaultContainerName="groep1_festivalsEntities" EnableFlattening="False">
                    <WhereParameters>
                        <asp:ControlParameter DefaultValue="-1" ControlID="festGrid" DbType="Int32" Name="fest_id" PropertyName="SelectedDataKey.values('fest_id')" />
                    </WhereParameters>
                    <OrderByParameters>
                        <asp:ControlParameter ControlID="bandGrid" DefaultValue="datum,uur" />
                    </OrderByParameters>
                </asp:EntityDataSource>
            </div>
        </div>
</asp:Content>
